package org.csmzxy233402;

class Staff {
    String name;
    int salary;
}
public class example02 {
    public static void modifySalary(int salary){
        salary += 1000;
    }
    public static void modifySalary(Staff staff){
        staff.salary += 1000;
    }
    public static void main(String[] args){
        Staff staff = new Staff();
        staff.name = "小明";
        staff.salary = 5000;
        System.out.println(staff.name+"原本薪水是:"+staff.salary+"元/月");
        modifySalary(staff.salary);
        System.out.println("值传递加薪是:"+staff.salary+"元/月");
        modifySalary(staff);
        System.out.println("引用传递加薪是:"+staff.salary+"元/月");
    }
}
